var express = require('express');
var router = express.Router();
var http = require('http');

var hostname = '127.0.0.1';
var port = 8080;

var options = {
    hostname:hostname,
    port:port,
    path:'/'

};

/* GET users listing. */
router.get('/', function(req, res, next) {

    http.get(options,function (response) {

        response.on('data',function (data) {

            var str = data.toString();
            console.log(str);
            res.send(str);
        });

    });

});

router.get('/index', function(req, res, next) {
    res.render('index', { title: 'Express' });
});

module.exports = router;
